#ifndef myMessage_h__
#define myMessage_h__

#include "../inc/sky.h"
#include "./myHandler.h"
namespace Framework
{
	using namespace Sky;

	class myEventManager;

	class Message : public Object
	{
		DECL_RTTI1(Message,Object);
	public:
		template <typename cls>
		Message(MsgStatus (cls::*event)(myEventManager*,Message*),Object* sender = vNull,Object* message = vNull):_event((Handler::EventId)event),_sender(sender),_message(message){}
		Object* getMessage(){return _message;}
		
		Handler::EventId getEvent(){return _event;}
	protected:
		ObjectPtr _sender;
		ObjectPtr _message;
		Handler::EventId  _event;
	};
	typedef RefPtr<Message> MessagePtr;
}
#endif // myEvent_h__